package wiki.xsx.core.bytecode.handler;

import lombok.Setter;

import java.util.Objects;

/**
 * 抽象助手
 *
 * @author xsx
 * @date 2023/2/22
 * @since 1.8
 * <p>
 * Copyright (c) 2023 xsx All Rights Reserved.
 * easy-bytecode is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 * http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 * </p>
 */
@Setter
public abstract class AbstractHandler {

    /**
     * 是否写入
     */
    protected Boolean isWrite;
    /**
     * 文件目录
     */
    protected String fileDir;

    /**
     * 参数检查
     *
     * @param values 参数列表
     */
    protected void check(Object... values) {
        for (Object value : values) {
            Objects.requireNonNull(value, "the param value can not be null");
        }
    }
}
